package com.ry.Thread;

public class ThreadExp implements Runnable{
    @Override
    public void run() {
        System.out.println("线程执行");
        try{
            Thread.sleep(3000);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws Exception {
        ThreadExp threadExp = new ThreadExp();
        Thread t = new Thread(threadExp);

        t.start();
        System.out.println("执行");
        t.join();
        System.out.println("主线程执行");

    }
}
